CREATE TABLE jms_dm.dm_mng_customer_daliy_customer_summary_dt
(
    code                     varchar(100) COMMENT '客户code',
    mall_id                  varchar(100) COMMENT '商家id（主要对接第三方客户）',
    name                     varchar(100) COMMENT '客户name',
    mall_name                varchar(100) COMMENT '商家名称',
    customer_network_id      varchar(100) COMMENT '客户所属网点id',
    customer_network_code    varchar(100) COMMENT '客户所属网点code',
    customer_network_name    varchar(100) COMMENT '客户所属网点name',
    project_name             varchar(100) COMMENT '项目名称',
    date_time                date COMMENT '日期',
    waybill_total            int(11) COMMENT '总订单量',
    cancel_num               int(11) COMMENT '总取消量',
    need_taking_num          int(11) COMMENT '应揽收量',
    actual_taking_num        int(11) COMMENT '实际揽收量',
    no_taking_num            int(11) COMMENT '有单未揽收量',
    lack_taking_num          int(11) COMMENT '有单漏揽收量',
    transport_num            int(11) COMMENT '运输中量',
    del_war_num              int(11) COMMENT '派件中量',
    no_safe_num              int(11) COMMENT '未妥投量',
    sign_num                 int(11) COMMENT '已签收量',
    intercept_num            int(11) COMMENT '拦截量',
    success_intercept_num    int(11) COMMENT '成功拦截量',
    7d_update_intercept_num  int(11) COMMENT '轨迹断更量',
    work_order_num           int(11) COMMENT '客诉量',
    arbitration_num          int(11) COMMENT '丢失量',
    express_num              int(11) COMMENT '破损量',
    xj_sign                  int(11) COMMENT '虚假签收量',
    sign_in_num              int(11) COMMENT '时效内签收量',
    sign_out_num             int(11) COMMENT '超时效签收量',
    nosign_in_num            int(11) COMMENT '时效内未签收量',
    nosign_out_num           int(11) COMMENT '超时效内未签收量',
    sign_rate                varchar(100) COMMENT '时效达成率',
    on_taking_sum            int(11) COMMENT '准点揽收量',
    have_taking_no_send_num  int(11) COMMENT '有揽未发量',
    have_send_no_arrival_num int(11) COMMENT '有发未到量'
) ENGINE=OLAP 
DUPLICATE KEY(code, mall_id)
COMMENT '客户日报-客户维度'
PARTITION BY RANGE(date_time)
(START ('2023-06-01') END ('2023-07-23') EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(code) BUCKETS 1
PROPERTIES (
'replication_num' = '3',
'dynamic_partition.enable' = 'true',
'dynamic_partition.time_unit' = 'DAY',
'dynamic_partition.time_zone' = 'Asia/Shanghai',
'dynamic_partition.start' = '-180',
'dynamic_partition.end' = '3',
'dynamic_partition.prefix' = 'p',
'dynamic_partition.buckets' = '1',
'in_memory' = 'false',
'storage_format' = 'V2'
);


